1 From 3dd2c2c507c271d411fab2e82a2b3b7e0b6d3f16 Mon Sep 17 00:00:00 2001
2 From: Kieran Bingham <kieran.bingham@ideasonboard.com>
3 Date: Mon, 28 Apr 2025 17:07:20 +0100
4 Subject: [PATCH] drivers: media: i2c: imx335: Fix frame size enumeration
6 In commit cfa49ff0558a ("media: i2c: imx335: Support 2592x1940 10-bit
7 mode") the IMX335 driver was extended to support multiple output modes.
9 This incorrectly extended the frame size enumeration to check against
10 the supported mbus_codes array instead of the supported mode/frame
11 array. This has the unwanted side effect of reporting the currently
12 supported frame size 2592x1944 three times.
14 Fix the check accordingly to report a frame size for each supported
15 size, which is presently only a single entry.
17 Fixes: cfa49ff0558a ("media: i2c: imx335: Support 2592x1940 10-bit mode")
18 Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
20 drivers/media/i2c/imx335.c | 3 ++-
21 1 file changed, 2 insertions(+), 1 deletion(-)
23 --- a/drivers/media/i2c/imx335.c
24 +++ b/drivers/media/i2c/imx335.c
25 @@ -720,7 +720,8 @@ static int imx335_enum_frame_size(struct
26 struct imx335 *imx335 = to_imx335(sd);
29 - if (fsize->index > ARRAY_SIZE(imx335_mbus_codes))
30 + /* Only a single supported_mode available. */
31 + if (fsize->index > 0)
34 code = imx335_get_format_code(imx335, fsize->code);